<%@ include file="/common/taglibs.jsp"%>
<probiz:pageHeading pageHeadingKey="taxRateDetail.heading" />
<content tag="buttons">
<probiz:iconBtn btnType="save" onclick="fnDoSave(this)" />
<c:if test="${taxRate.taxRateId!=null}">
	<probiz:iconBtn btnType="delete" onclick="fnDoDelete(this)" />
</c:if>
<probiz:iconBtn btnType="back" url="${ctxPath}/system/taxRate.html" />
</content>

<probiz:showBindErrors bindPath="taxRate.*" />

<script type="text/javascript">
//地区选择器回调函数
function regionSeclectCallback(region){
	$j('#regionId').val(region.id);
	$j('#regionName').html(region.fullName);
	closeDialogOfregionSelector();
	validateField($('regionId'),"required");
}
//自定义地区选择器回调函数
function userDefinedRegionSeclectCallback(region){
	$j('#regionId').val(region.id);
	$j('#regionName').html(region.name);
	closeDialogOfuserDefinedRegionSelector();
	validateField($('regionId'),"required");
}
	
</script>

<form class="mainForm" method="post" action="${ctxPath}/system/taxRate.html" id="taxRate"
	onsubmit="return validateTaxRate(this);">
	<div class="top clearfix">
		<ul class="tab">
			<li class="curr">
				<span><fmt:message key="taxRateDetail.heading" />
				</span>
			</li>
		</ul>
	</div>
	<spring:bind path="taxRate.taxRateId">
		<input type="hidden" name="taxRateId" value="<c:out value="${status.value}"/>" />
	</spring:bind>
	<input type="hidden" name="rateType" value="0" />

	<div class="modify">
		<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" class="com_modi_table">
			<tr>
				<th colspan="2" class="title">
					<h4>
						<fmt:message key="taxRate.group.condition" />
					</h4>
				</th>
			</tr>
			<tr>
				<th class="label_width_1">
					<StoreAdmin:label key="taxRate.productTypeId" />
				</th>
				<td>
					<select name="productTypeId" id="productTypeId" style="width: 200px" class="selecttxt">
						<option value=""><fmt:message key="taxRateDetail.pleaseSelect"/></option>
						<c:forEach items="${productTypeList}" var="productType" >
							<option value="${productType.productTypeId}"
								<c:if test="${productType.productTypeId==taxRate.productType.productTypeId}"> selected="selected" </c:if>>
								${productType.productTypeName}
							</option>
						</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<th>
					<StoreAdmin:label key="taxRate.taxId" />
				</th>
				<td>
					<select name="taxId" id="taxId" class="selecttxt" style="width: 200px;">
						<option value=""><fmt:message key="taxRateDetail.pleaseSelect"/></option>
						<c:forEach var="tax" items="${taxs}">
							<option value="${tax.taxId}"
								<c:if test="${tax.taxId==taxRate.taxId}"> selected="selected" </c:if>>
								${tax.taxName}
							</option>
						</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<th>
					<StoreAdmin:label key="taxRate.regionId" />
				</th>
				<td>
					<input type="hidden" id="regionId" name="regionId" value="${taxRate.regionId}" />
					
					<b>
						<span id="regionName"><c:if test="${not empty taxRate.region.fullName}">${taxRate.region.fullName}</c:if>
						</span>
					</b>

					<fmt:message key="shippingRateForm.pleaseSelect" />
					<input class="btn3" type="button"
						value="<fmt:message key="shippingRateForm.selectNormalRegion"/>"
						onclick="showDialogOfregionSelector()">
					<fmt:message key="shippingRateForm.regionOr" />
					<input class="btn3" type="button"
						value="<fmt:message key="shippingRateForm.selectUserDefinedRegion"/>"
						onclick="showDialogOfuserDefinedRegionSelector()">
					<span style="display: none"> <system:regionSelector selectorId="regionSelector"
							callbackFunc="regionSeclectCallback" /> <system:userDefinedRegionSelector
							selectorId="userDefinedRegionSelector" callbackFunc="userDefinedRegionSeclectCallback" /> </span>
				</td>
			</tr>
			<tr>
				<th colspan="2" class="title">
					<h4>
						<fmt:message key="taxRate.rateValue" />
					</h4>
				</th>
			</tr>
			<tr>
				<th>
					<StoreAdmin:label key="taxRate.rateValue" />
				</th>
				<td align="left">
					<input class="inputtxt" style="width: 350px" type="text" name="rateValue" id="rateValue"
						value="${taxRate.rateValue}" />
					%
				</td>
			</tr>
		</table>
	</div>
	</div>
	</div>
</form>

<v:javascript formName="taxRate" staticJavascript="false" />